<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
	<th:block th:include="include :: header('新增workerId')"/>
	<th:block th:include="include :: summernote-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-workerId-add">
		<div class="col-md-12">
			<div class="form-group">
				<label class="col-sm-3 control-label">命名空间：</label>
				<div class="col-sm-9">
					<input type="text" id="namespace" name="namespace" class="form-control" required
						   placeholder="请输入文本">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">主机IP：</label>
				<div class="col-sm-9">
					<input type="text" id="hostIp" name="hostIp" class="form-control" required placeholder="主机IP">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">节点ID：</label>
				<div class="col-sm-9">
					<input id="workerId" name="workerId" class="form-control"  min="0"  step="1" type="number" required placeholder="节点ID">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-9">
					<textarea type="text" id="remark" name="remark" class="form-control" placeholder="请输入备注"></textarea>
				</div>
			</div>
		</div>
	</form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: summernote-js"/>
<script type="text/javascript">
	var prefix = ctx + "leaf/workerId";

	$('.summernote').summernote({
		placeholder: '请输入内容',
		height: 192,
		lang: 'zh-CN',
		followingToolbar: false,
		callbacks: {}
	});

	$("#form-workerId-add").validate({
		focusCleanup: true
	});

	function submitHandler() {
		if ($.validate.form()) {
			var sHTML = $('.summernote').summernote('code');
			$("#remark").val(sHTML);
			$.operate.save(prefix + "/add", $('#form-workerId-add').serialize());
		}
	}
</script>
</body>
</html>
